import java.sql.Time;
import java.util.Date;

import javax.swing.JFrame;
import javax.swing.JPanel;

import boundary.DisableSaveActivatePlSpotGui;
import boundary.ISMainGui;
import boundary.MainGui;
import boundary.ParkingLotWorkerGui;
import boundary.SubscriptionOrderGui;

import controller.*;
import entity.*;


public class main {
	public static void main (String []args)
	{
		//reguler main
		
		
		MainGui gui=new MainGui();
		gui.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	    gui.setSize( 710,320 ); // set frame size
	    gui.setVisible( true ); // display frame
		
	    
	    /*
	    //IS main
	    ISMainGui gui=new ISMainGui();
		gui.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	    gui.setSize( 710,320 ); // set frame size
	    gui.setVisible( true ); // display frame
	    */
	    
	    /*
	    //Parking Lot Worker
	    ISMainGui gui=new ISMainGui();
		gui.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	    gui.setSize( 710,320 ); // set frame size
	    gui.setVisible( true ); // display frame
	    
	    JFrame frame=ISMainGui.getFrame();
		ParkingLotWorkerGui plwGui=new ParkingLotWorkerGui();
		plwGui.setLastPanel((JPanel)frame.getContentPane());
		plwGui.setFrame(frame);
		frame.setContentPane(plwGui);
		frame.setVisible(true);
	    */
	    
	    
		//TEST1
/*		ParkingLot pl=new ParkingLot();
		pl.createParkingLot(1, 2, 3);
		Date start1=new Date();
		start1.setMinutes(15);
		start1.setHours(2);
		Date end1=new Date();
		end1.setMinutes(30);
		end1.setHours(5);
		
		Date start2=new Date();
		start2.setMinutes(15);
		start2.setHours(2);
		Date end2=new Date();
		end2.setMinutes(30);
		end2.setHours(5);
	
		Date start3=new Date();
		start3.setMinutes(30);
		start3.setHours(1);
		Date end3=new Date();
		end3.setMinutes(45);
		end3.setHours(5);
		
		pl.printOrders();
		System.out.println();
		if (pl.addOrder(start1, end1))
		pl.printOrders();
		System.out.println();
		if (pl.addOrder(start2, end2))
		pl.printOrders();
		System.out.println();
		pl.addOrder(start3, end3);
		
		if(pl.removeOrder(start3, end3))
		pl.printOrders();
		System.out.println();
	*/
		
		//TEST 2
	/*	ParkingLot pl=new ParkingLot();
		pl.createParkingLot(3, 3, 8);
		int[]ij;
		int ind;
		for(int i=0; i<3*8;i++)
		{
			ij=pl.getIJ(i);
			ind=pl.getDistanceIndex(ij[0], ij[1]);
			System.out.println(i+"  ("+ij[0]+","+ij[1]+")  "+ind);
		}*/
	
		//TEST 3
		/*
		ParkingLot pl=new ParkingLot();
		pl.createParkingLot(3, 3, 4);
		Date [] d=new Date[3*3*4];
		for (int i=0; i<3*3*4; i++)
		{
			d[i]=new Date();
			d[i].setTime(d[i].getTime() + 1000*60*60*i);
		}
		for (int i=0; i<3*3*4/2; i++)
		{
			if(!pl.insertCar(String.valueOf(i*2),d[i*2]))
				System.out.println(i*2);
			
		}
		System.out.println(pl);
		pl.disableSpot(2, 1, 2);
		pl.saveSpot(2, 0, 2);
		System.out.println(pl);
		for (int i=0; i<3*3*4/2; i++)
		{
			if(!pl.insertCar(String.valueOf(i*2+1),d[i*2+1]))
				System.out.println(i*2+1);
		}
		System.out.println(pl);
		pl.popCar("1");
		pl.popCar("0");
		pl.popCar("2");
		//System.out.println(pl);
	*/
	}

}
